package main

import "fmt"

func main() {
	var (
		age   int     = 30
		heigh float64 = 1.68
		motto string  = "一心一意，三心二意，四书五经"
	)
	pointer01, pointer02, pointer03 := &age, &heigh, &motto
	pointer04, pointer05, pointer06 := &age, &heigh, &motto
	pointer07, pointer08, pointer09 := new(int), new(float64), new(string)

	fmt.Println(&age, &heigh, &motto)
	fmt.Println(pointer01, pointer02, pointer03)
	fmt.Println(pointer04, pointer05, pointer06)
	fmt.Println(pointer07, pointer08, pointer09)

	fmt.Println("===============")
	fmt.Println(age, heigh, motto)
	fmt.Println(*pointer01, *pointer02, *pointer03)
	fmt.Printf("%v,%v,%q\n", *pointer07, *pointer08, *pointer09)

	fmt.Println("===============")
	fmt.Println(age, heigh, motto)
	fmt.Println(*pointer01, *pointer02, *pointer03)
	*pointer01 += 1
	*pointer02 = 1.70
	*pointer03 += "六六大顺"
	fmt.Println(*pointer01, *pointer02, *pointer03)
	fmt.Println(age, heigh, motto)

	fmt.Println(&age, &heigh, &motto)
	fmt.Println(pointer01, pointer02, pointer03)

	fmt.Println("===============")
	age2, heigh2, motto2 := age, heigh, motto
	age2 += 1
	heigh2 = 1.72
	motto2 += "成语"

	fmt.Println(age, heigh, motto)
	fmt.Println(age2, heigh2, motto2)

	fmt.Println(&age, &heigh, &motto)
	fmt.Println(&age2, &heigh2, &motto2)

	fmt.Println("===============")
	var ppointer01 **int
	var ppointer02 **float64 = &pointer02
	ppointer03 := &pointer03

	fmt.Println(ppointer01, ppointer02, ppointer03)

	ppointer01 = &pointer01
	fmt.Println(ppointer01, ppointer02, ppointer03)

	fmt.Println(*ppointer01,*ppointer02,*ppointer03)
	fmt.Println(**ppointer01,**ppointer02,**ppointer03)

	**ppointer01 += 1
	**ppointer02 = 1.72
	**ppointer03 += "古文"

	fmt.Println(**ppointer01,**ppointer02,**ppointer03)
	fmt.Println(*pointer01, *pointer02, *pointer03)
	fmt.Println(age, heigh, motto)
}
